package com.vhall.component.plugin.common.constant;

import java.io.Serializable;

/**
 * @author yongzheng.xu
 * @date 2021/5/16 18:01
 */
public class RedisKey implements Serializable {

    public static final String TOKEN_PARTITION = ":";

    public static final String TOKEN_PERMIT_PREFIX = "access:";

    public static final String AUTH_TOKEN = "auth:token:";

    public static final String USER_TICKET_KEY_PREFIX = "auth:user_ticket:";

    public static final String ROLE_PERMISSION = "auth:role:permi:";

    public static final String CODE_KEY = "comp:phone:code:";

    public static final String INTERVAL_KEY = "comp:phone:code:interval:";

    /**
     * room:question:answered:account:id:
     */
    public static final String QUESTION_ANSWERED_LOCK = "comp:survey:answer:lock:";

    /**
     * opModel:RoomQuestionLkModel:InfoByRoomIdAndQuestionId:
     */
    public static final String QUESTION_INFO_KEY = "comp:survey:lk:info:";

    /**
     * opModel:QuestionModel:InfoByQuestionId:
     */
    public static final String QUESTION_INFO_BY_ID = "comp:survey:info:";

    /**
     * opModel:InfoByQuestionId:
     */
    public static final String QUESTION_INFO_OP_KEY = "comp:survey:info:op:";

    /**
     * opModel:InfoBySourceId:
     */
    public static final String QUESTION_INFO_BY_SOURCE_ID = "comp:survey:info:sid:";

    /**
     * 房间队列
     */
    public static final String FORM_QUEUE_ROOM_IDS = "form_queue_room_ids";

    /**
     * 队列- 用户同步游客信息
     */
    public static final String QUEUE_QUESTION_SYNC_VISITOR_INFO = "form_queue_question_info_";

    /**
     * 存队列名称集合的键
     */
    public static final String QUEUE_NAMES_KEY = "queue:names";
    /**
     * 推屏时间间隔
     */
    public static final String QUESTION_PUSH = "op:question:push:";

    // endregion 问卷相关RedisKey

    // region inav 相关
    /**
     * opModelRoomJoinsModelInfoByAccountIdAndRoomId:
     */
    public static final String ROOM_JOIN_FLAG = "comp:room:joins:flag:";

    /**
     * opModelRoomJoinsModelInfoByJoinId
     */
    public static final String ROOM_JOIN_FLAG_BY_JID = "comp:room:joins:jid:";

    /**
     * opModelRoomsModelInfoByRoomId
     * xxopModelRoomsModelInfoByRoomId:
     */
    public static final String ROOM_INFO_BY_ROOM_ID = "comp:room:info:";

    /**
     * xxopModelRoomJoinsModelHostByRoomId
     */
    public static final String ROOM_JOIN_INFO_CACHE = "comp:room:join:";


    /**
     * 参会信息数据缓存key前缀，拼接roomIdaccountId
     */
    public static final String ROOM_JOIN_DATA_CACHE_PRE_KEY = "all:room_joins:data:";


    /**
     * 踢出列表缓存key前缀，拼接roomId
     */
    public static final String ROOM_JOIN_KICKED_IDS_CACHE_PRE_KEY = "comp:room_joins:kicked_ids:";

    /**
     * 禁言列表缓存key前缀，拼接roomId
     */
    public static final String ROOM_JOIN_BANNED_IDS_CACHE_PRE_KEY = "comp:room_joins:banned_ids:";

    /**
     * xxRoomExtendsModel:
     */
    public static final String ROOM_EXTEND_CACHE = "comp:room:extend:";

    /**
     * opModelRoomJoinsModelGetBannedNum
     */
    public static final String ROOM_BANNED_NUM = "comp:room:banned:num:";

    /**
     * xxopModelRebroadCastModelStartInfoByRoomId
     */
    public static final String REBROADCAST_INFO = "comp:rebroadcast:info:";
    /**
     * opModel:StartInfoByRoomId:
     */
    public static final String REBROADCAST_START_INFO = "comp:rebroadcast:start:info:";


    /**
     * records:down:vod_id:
     */
    public static final String RECORD_DOWN_URL = "comp:record:url:vid:";

    /**
     * records:down:qality:vod_id:
     */
    public static final String RECORD_DOWN_QA_URL = "records:url:quality:vid:";

    /**
     * 缓存签到前缀
     */
    public static final String SIGN_KEY_PREFIX = "comp:sign:";

    // region ---------------------------并发控制---------------------------------------
    /**
     * 应用下当前连接数量
     */
    public static final String CONNECT_COUNT_BY_APP = "comp:ctrl:connect_num_app";

    /**
     * 房间下当前连接数数量
     */
    public static final String CONNECT_COUNT_BY_ROOM = "comp:ctrl:one:connect_num_ilid:";

    /**
     * 账户下直播中房间 living:rooms:account_id:
     */
    public static final String LIVING_ROOMS_OF_ACCOUNT = "comp:ctrl:account:all:live:room:";


    public static final String LIVING_ROOMS_OF_APPS = "comp:ctrl:apps";


    /**
     * 并发控制 排队用户队列 queue:perfctl:il_id:
     */
    public static final String QUEUE_PERF_CTL_ILID = "comp:ctrl:queue:ilid:";

    public static final String QUEUE_CTRL = "comp:ctrl:keys";

    public static final String ALL_ACCOUNTIDS = "comp:ctrl:all:ids:ilid:";

    /**
     * 队列广播用户暂存集合
     */
    public static final String NOTIFY_ACCOUNT_LIST_ILID = "comp:ctrl:notify:accounts:ilid:";

    /**
     * 房间(账户)剩余连接数
     */
    public static final String CONNECT_COUNT_OF_ACCOUNT_BY_ILID = "comp:ctrl:connect_num_account:";

    /**
     * 正在开播的房间 - 房间并发限制判断 perfctl:beginning:ilinfo
     */
    public static final String CTRL_LIVING_ROOM_SET = "comp:ctrl:living:room";

    /**
     * 请求频率锁
     */
    public static final String CTRL_REQ_CONNECT_LOCK = "comp:ctrl:req_connect:";

    /**
     * 并发到达上线通知锁 lock_notice_limited_
     */
    public static final String CTRL_NOTICE_LIMITED_LOCK = "comp:ctrl:notice_limited:";

    /**
     * 队列锁定时间 lock_queue_cron_exec
     */
    public static final String CTRL_QUEUE_CRON_EXEC_LOCK = "comp:ctrl:queue_cron_exec";

    /**
     * 锁控制队列处理频率 lock_queue_deal_
     */
    public static final String CTRL_QUEUE_DEAL_LOCK = "comp:ctrl:queue_deal:";

    //endregion
    // region ------互动------
    public static final String INTERACT_INVITE = "comp:inav:invite:";

    /**
     * 互动上麦中用户id缓存，拼接room_id
     * sorted_set方式，member -> account_id score -> 当前时间
     */
    public static final String INTERACT_WAITING_FOR_WHEAT = "comp:inav:waiting_for_wheat:";

    /**
     * op:interact:speaker:
     */
    public static final String INTERACT_SPEAKER = "comp:inav:speaker:";

    /**
     * 1申请 2同意 3拒绝 4取消
     * op:interact:handsup:
     */
    public static final String INTERACT_HANDSUP = "comp:inav:handsup:";

    /**
     * op:interact:global:
     */
    public static final String INTERACT_GLOBAL = "comp:inav:global:";

    /**
     * 房间下其他互动工具的信息 op:interact:tool:
     */
    public static final String INTERACT_TOOL = "comp:inav:tool:";

    /**
     * 房间下其他互动工具浮窗记录 op:interact:tool:records
     */
    public static final String INTERACT_TOOL_RECORDS = "comp:inav:tool:records";


    // endregion

    //抽奖
    /**
     * 抽奖规则(标题)
     */
    public static final String KEY_LOTTERY_RULE_TEXT = "comp:lottery:rule:text:";
    public static final String KEY_LOTTERY_TYPE_LIKE = "comp:lottery:type:like:";
    public static final String KEY_LOTTERY_JOIN = "comp:lottery:join:";
    public static final String KEY_LOTTERY_COMMENT_JOIN = "comp:lottery:join:";
    public static final String KEY_LOTTERY_TYPE_COMMENT = "comp:lottery:type:comment:";

    /**
     * 符合条件的抽奖用户范围 自定义导入用户
     */
    public static final String LOTTERY_RANGE_IMPORT = "comp:lottery:range:import:";
    public static final String LOTTERY_RANGE_LIMIT = "comp:lottery:range:limit:";

    /**
     * 符合条件的抽奖用户范围 指定列表随机
     */
    public static final String LOTTERY_RANGE_ACCOUNTS = "comp:lottery:range:accounts:";

    /**
     * 开始抽奖防并发提交
     */
    public static final String LOTTERY_ADD_LOCK = "comp:lottery:add:lock:";
    /**
     * 开始抽奖防并发提交
     */
    public static final String LOTTERY_EXTENSION = "comp:lottery:extension:";

    /**
     *
     */
    public static final String LOTTERY_ROLE = "comp:lottery:role:";

    /**
     * 房间 op:room:global:
     */
    public static final String ROOM_GLOBAL = "comp:room:global:";
    /**
     * 暖场信息  warm:info:
     */
    public static final String WARM_INFO = "comp:room:warm:info:";

    /**
     * 暖场视频信息  warm:video_info:
     */
    public static final String WARM_VIDEO_INFO = "comp:room:warm:video_info:";

    /**
     * 同channel定时任务键值相同 livingchanneluseronlinecount
     */
    public static final String LIVING_CHANNELS_KEYS = "comp:room:channel_online_user_num";

    /**
     * 点赞
     */
    public static final String ROOM_LIKE_COUNTS = "comp:room:like:";
    public static final String ROOM_LIKE_ACCOUNT = "comp:room:account:";
    public static final String ROOM_LIKE_WAIT_CACHE = "comp:room:like:wait:write";


    /**
     * 敏感词key filter_words:
     */
    public static final String FILTER_WORDS_CACHE_KEY = "comp:filter:";

    /**
     * 已加载关键词列表
     */
    public static final String FILTER_WORDS_ILID_SET = "comp:filter:ilid_list";

    /**
     * 支付 op:enjoyvss:tradeno:
     */
    public static final String TRADE_NO = "comp:pay:tradeno:";


    /**
     * 记录正在进行中的投票 ID,
     */
    public static final String INTERACT_TOOL_FILED = "vote_id";

    /**
     * 投票异步落地 锁
     */
    public static final String VOTE_ANSWER_SYNC_LOCK = "comp:vote.answer-sync";

    //queue:vote:roomId 投票回答的房间的集合
    public static final String VOTE_ANSWER_ROOMS_QUEUE = "comp:vote:queue:rooms:";

    //延时队列 存储所有待结束投票数据
    public static final String VOTE_FINISH_RLKID_QUEUE = "comp:vote:queue:rlkid:";

    public static final String VOTE_DELAY_QUEUE = "comp:vote:delay:list";
    /**
     * 抽奖队列
     */
    public static final String LOTTERY_DELAY_QUEUE = "comp:lottery:delay:list";
    /**
     * 发起抽奖url
     */
    public static final String LOTTERY_REQUEST_URL = "comp:lottery:request:url:";
    public static final String VOTE_DELAY_ID = "comp:vote:delay:";
    public static final String LOTTERY_DELAY_ID = "comp:lottery:delay:";

    public static final String VOTE_PUSH_FLAG = "comp:vote:push:";


    //queue:vote:roomId 投票回答的LIST名称存储集合
    public static final String VOTE_ANSWER_LIST_QUEUE = "comp:vote:queue:list:";

    //投票
    public static final String VOTE_RVLK = "comp:vote:rvlk:";

    public static final String VOTE_QUESTION = "comp:vote:question:";

    public static final String VOTE_INFO_OSS_URL = "comp:vote:oss:url:";

    /**
     * 房间内投票信息缓存key前缀，拼接roomId
     * hash模式，其中，hashKey -> voteId，hashValue -> 投票信息
     */
    public static final String ROOM_VOTE_LK_DATA_CACHE_PRE_KEY = "comp:vote:lk_data:";

    /**
     * 投票信息缓存key前缀，拼接voteId
     * 字符串模式，其中，value -> 投票信息
     */
    public static final String VOTE_DATA_CACHE_PRE_KEY = "comp:vote:data:";

    /**
     * 投票提交信息缓存key前缀，拼接answerId
     * 字符串模式，其中，value -> 投票提交信息
     */
    public static final String VOTE_ANSWERS_DATA_CACHE_PRE_KEY = "comp:vote:answers:data:";

    /**
     * 观看端问卷缓存key前缀，拼接roomId:queryKey
     * 其中，queryKey指的是一个能区分查询条件的base64
     */
    public static final String WATCH_SIDE_QUESTION_DATA_CACHE_PRE_KEY = "comp:question:watch_side:data:";

    /**
     * 房间内问卷填写人数统计，拼接roomId
     * hash，key -> question_id, value -> answer_number
     */
    public static final String QUESTION_ANSWER_NUMBER_CACHE_PRE_KEY = "comp:question:answer_number:";

    /**
     * 房间内用户填写答卷关联，拼接roomId
     * hash
     */
    public static final String QUESTION_USER_LATEST_ANSWER_REF_CACHE_PRE_KEY = "comp:question:user_latest_answer_ref:";

    public static final String QUESTION_INFO_OSS_URL = "comp:question:oss:url:";

    /**
     * 打赏
     */
    // region 打赏常量
    public static final String REWARD_RANK = "comp:reward:rank:";
    public static final String REWARD_COUNT = "comp:reward:count:";

    /**
     * 考试
     */
    public static final String EXAM_INFO = "comp:exam:info:";
    public static final String EXAM_ANSWER_ACCOUNTS_SET = "comp:exam:answer:accounts:";
    public static final String EXAM_FINISH_SUBMIT_LOCK = "comp:exam:exam_finish_submit";
    public static final String EXAM_GRADED_MARK_LOCK = "comp:exam:graded_mark_lock:";

    /**
     * 考试信息缓存key前缀，拼接examId
     * string模式
     */
    public static final String EXAM_DATA_CACHE_PRE_KEY = "comp:exam:data:";

    /**
     * 房间内考试回答列表，拼接roomId
     * hash，key -> 请求参数字符串化, value -> list_str
     */
    public static final String EXAM_ANSWERED_LIST_CACHE_PRE_KEY = "comp:exam:answered_list:";

    /**
     * 房间内查看考试结束状态，拼接roomId
     * hash，key -> exam_id, value -> 0 / 1
     */
    public static final String EXAM_FINISH_STATUS_CACHE_PRE_KEY = "comp:exam:finish_status:";

    /**
     * 房间考试信息缓存key前缀，拼接roomId
     * hash，key -> examId, value -> 房间考试信息
     */
    public static final String ROOM_EXAM_LK_DATA_CACHE_PRE_KEY = "comp:exam:lk_data:";

    /**
     * 问答
     */
    public static final String QA_KEY_PREFIX = "comp:qa:ques:";
    public static final String QA_KEY_ANSWER_PREFIX = "comp:qa:answer:";
    public static final String QA_KEY_ROOM_U_REL = "comp:qa:room-u-rel:";

    public static final String QA_OPEN = "qa_open";
    public static final String QA_ALSO_ASK_OPEN = "qa_also_ask_open";

    public static final String TAG_INFO_BY_IDS = "comp:tag:info:ids:";

    /**
     * 观看限制
     */
    public static final String APPLY_INFO_BY_ROOM_ID = "comp:watchlimit:apply:info:roomid:";

    /**
     * 直播间演示文档list
     */
    public static final String ROOM_DOC = "comp:room:doc:list";


    public static final String ROOM_DOC_INFO = "comp:room:doc:info:";

    public static final String NO_CHAT = "nochat";
    /**
     * 默认水印模板id
     */
    public static final String DEFAULT_WATERMARK_TEMPLATE_KEY = "comp:watermark:default:template:id";

    /**
     * 存放开始直播的状态变更中间态
     */
    public static final String ROOM_LIVE_START_CHANGE_STATUS_KEY = "comp:room:live:start:change:status:";
    /**
     * 对于房间推送问卷频率进行限定
     */
    public static final String QUESTION_REPUSH_INTERVAL_KEY = "comp:question:repush:interval:";

    /**
     * 访问pass 日志开启标记
     */
    public static final String PASS_LOG = "comp:pass:log";

    /**
     * 访问pass 日志开启标记 task工程
     */
    public static final String PASS_LOG_TASK = "comp:pass:log:task";

    /**
     * 录播视频加入缓存 key  comp:recorded_video_list
     */
    public static final String RECORDED_VIDEO_LIST = "comp:recorded_video_list";

    /**
     * 录播视频加入缓存 key  comp:recorded_video:房间il_id
     */
    public static final String RECORDED_VIDEO_SINGLE = "comp:recorded_video:";

    /**
     * 指定视频封面图 后面加 视频id
     */
    public static final String FIRST_FRAME_FROM_VIDEO = "comp:first_frame_from_video:";

    /**
     * 给房间自动生成默认回放标记位 后面跟的是room_id
     */
    public static final String ROOM_DEFAULT_RECORD = "comp:room:default:record:";

    /**
     * 广告定时下架任务队列
     */
    public static final String REGULAR_DOWN_ADVER_TASK_LIST = "comp:regular_down_adver_list";

    /**
     * 广告定时下架任务队列 后跟广告id
     */
    public static final String REGULAR_DOWN_ADVER_TASK = "comp:regular_down_adver:";


    /**
     * 前端需要根据此判断是跳转页面还是app
     */
    public static final String FRONT_VERSION = "comp:version";
    /**
     * 用户角色
     */
    public static final String ROLE_PERMISSION_MENUS = "auth:role:permission:menus:";
    public static final String CREATE_ORG_LOCK_KEY = "comp:create:org:lock:";

    public static final String RISK_WARNING_KEY = "comp:room:risk:warning";

    /**
     * 聚合页缓存key
     * cache getFirstChannel
     */
    public static final String CACHE_GETBANNERLIST = "cache:getBannerList";
    public static final String CACHE_LIVESCHEDULE = "cache:liveSchedule";
    public static final String CACHE_GETCOLUMNLIST = "cache:getColumnList";

    /**
     * 栏目订阅
     */
    public static final String CACHE_COLUMN_SUB = "cache:column:sub";

    public static final String CACHE_COLUMN_SUB_SET = "cache:column:sub:set:";
    public static final String CACHE_SELECTEDVIDEOLIST = "cache:selectedVideoList";
    public static final String CACHE_SELECTEDVIDEOLIST_COUNT = "cache:selectedVideoList:count";
    public static final String CACHE_SELECTEDVIDEOLIST_GETPVCOUNTFROMSTATICS = "cache:selectedVideoList:getPvCountFromStatics";
    public static final String CACHE_SEARCHVIDEOLIST = "cache:searchVideoList";

    /**
     * 国信专用，资源图片
     */
    public static final String RESOURCE_IMAGE_GX = "guoxin:resource_image";
    /**
     * 缓存投资依据信息
     */
    public static final String INVEST_REF_INFO_CACHE = "cache:invest_ref:info:cache:";
    /**
     * 回放视频的章节打点列表缓存
     */
    public static final String RECORD_CHAPTER_LIST_KEY = "cache:record:chapter:list:";

    /**
     * 直播提交送审缓存
     */
    public static final String SUBMIT_FOR_APPROVAL = "cache:submit_for_approval:";

    /**
     * 直播撤销送审缓存
     */
    public static final String REVOKE_REVIEW = "cache:revoke_review:";
    public static final String RECORD_INFO_ID = "cache:record:info:id:";

    public static final String CACHE_LIVE_BOOKING = "cache:live_booking";
    public static final String CACHE_LIVE_BOOKING_COUNT = "cache:live_booking:count";

    public static final String CACHE_VIEWING_RECORDS = "cache:viewing_records";
    public static final String CACHE_VIEWING_RECORDS_COUNT = "cache:viewing_records:count";
    /**
     * 缓存全部的白名单手机号-不重复的
     */
    public static final String ALL_ROOM_WHITE_PHONE_SET = "cache:room:white:phone:set";
    /**
     * 全量的私募账号缓存
     */
    public static final String ALL_GUO_SEN_FUNDID_SET = "cache:guo:sen:fundid:set";
    /**
     * 缓存一个国信投顾的信息
     * 用户缓存内部员工的投顾信息
     */
    public static final String GUO_SEN_STAFF_USER_INFO = "cache:guo:sen:staff:user:info:";

    /**
     * 缓存,一天中某个投顾信息,用户关注情况
     * 使用类型hash
     * key 为 固定+投顾 id:日期
     * 内容为: 用户id+是否关注
     */
    public static final String GUO_SEN_STAFF_USER_FOLLOW_DATE = "cache:guo:sen:staff:user:follow:date";
    /**
     * 缓存一个房间关联的投顾信息
     */
    public static final String ROOM_ANCHOR_LIST_CACHE = "cache:room:anchor:list:";
    /**
     * 缓存一个房间在某一天是否弹出过提醒
     * 使用类型:set
     */
    public static final String ROOM_LIVE_DATE_SUBSCRIBE_ALERT = "room:live:date:subscribe:alert";
    /**
     * 缓存一个栏目在某一天是否弹出过提醒
     * 使用类型:set
     */
    public static final String ROOM_COLUMN_DATE_SUBSCRIBE_ALERT = "room:column:date:subscribe:alert";
    /**
     * 缓存一个投顾在某一天是否弹出过提醒
     * 使用类型:set
     */
    public static final String ROOM_TGH_DATE_SUBSCRIBE_ALERT = "room:tgh:date:subscribe:alert";
    /**
     * 缓存 - 直播观看数据 list- 栏目
     */
    public static final String DP_LIVE_VIEW_DATA_LIST_COLUMN = "cache:dp:live:view:data:list:column";
    /**
     * 缓存 - 直播观看数据 list- 主播
     */
    public static final String DP_LIVE_VIEW_DATA_LIST_ANCHOR = "cache:dp:live:view:data:list:anchor";
    /**
     * 缓存 - 全量的国信组织架构区域缓存
     */
    public static final String GUO_SEN_ORG_ALL_LIST = "cache:guo:sen:org:all:list";
    /**
     * 缓存 - 直播间外部渠道观看统计数据
     */
    public static final String CACHE_LIVE_EXTERNAL_CHANNEL_VIEW_COUNT = "cache:live:external:channel:view:count:";
}
